package Classes.Collisions 
{
	import net.flashpunk.Entity;
	
	/**
	 * ...
	 * @author Alex
	 */
	public class CollisionDetector 
	{
		
		public function CollisionDetector() 
		{
			
		}
		public function getCollisions(entity:Entity):Array
		{	
			var types:Array = getCollidableTypes();
			
			var typesCollidedWith:Array = new Array();
			for each (var entityType:String in types)
			{
				var entityTypeCollidedWith:Entity = entity.collide(entityType, entity.x, entity.y)
				
				if (entityTypeCollidedWith != null)
				{
					typesCollidedWith.push(entityTypeCollidedWith);
				}
			}
			
			return typesCollidedWith;
			
		}
		
		private function getCollidableTypes():Array
		{
			var types:Array = new Array();
			types.push(ObjectTypes.ENEMY_TANK);
			types.push(ObjectTypes.LEVEL);
			types.push(ObjectTypes.BULLET);
			return types;
		}
		
	}
	
}